package br.com.contil.lid.dao.book;

import java.util.*;
import javax.persistence.*;

import br.com.contil.lid.dao.*;
import br.com.contil.lid.to.book.*;
import br.com.contil.lid.metamodel.book.*;

public class BookDAO extends BaseDAO<BookTO, Long> {

	public BookDAO(){
		super(BookTO.class);
	}
	
	public void filterById(Long id) {
		addPredicate(getBuilder().equal(getRoot().get(BookTO_.id), id));
	}
	
	public void filterByName(String name) {
		addPredicate(getBuilder().equal(getRoot().get(BookTO_.name), name));
	}
	
	public void filterByChaptersIds(List<Long> chaptersIds){
		addPredicate(getBuilder().equal(getRoot().get(BookTO_.chaptersIds), chaptersIds));
	}
}